package cn.com.egova.skinapplication.skin;

import android.content.Context;
import android.content.SharedPreferences;

import cn.com.egova.skinapplication.skin.config.Constant;

/**
 * Created by yuanchao on 2017/3/13.
 */

public class PrefUtils {
    private Context mContext;
    private SharedPreferences sp;

    public PrefUtils(Context context){
        this.mContext=context;
        sp = mContext.getSharedPreferences(Constant.PREF_NAME, Context.MODE_PRIVATE);
    }

    public void savePluginPath(String path){
        sp.edit().putString(Constant.KEY_PLUGIN_PATH,path).commit();
    }


    public void savePluginPkg(String pkgName){
        sp.edit().putString(Constant.KEY_PLUGIN_PKG,pkgName).commit();
    }

    public void saveSuffix(String suffix){
        sp.edit().putString(Constant.KEY_SUFFIX,suffix).commit();
    }

    public String getPluginPath(){
        return sp.getString(Constant.KEY_PLUGIN_PATH,"");
    }

    public String getPluginPkg(){
        return sp.getString(Constant.KEY_PLUGIN_PKG,"");
    }

    public String getSuffix(){
        return sp.getString(Constant.KEY_SUFFIX,"");
    }

    public void clear() {
        sp.edit().clear().commit();
    }
}
